<!DOCTYPE html>
<html>

<head>
	<meta charset="UTF-8">
	<title>minglie跨域测试</title>
	<script src="https://minglie.gitee.io/mingpage/static/public/jquery/1.11.3/jquery-1.11.3.js"></script>

	<style>
		button {
			width: 500px;
			height: 30px;
			margin-top: 10px;
		}
	</style>

</head>



<body>
	<button id="btn1">get1</button>
	<button id="btn2">postJson</button>
	<script>

		let baseUrl = "http://server.com"

		//let baseUrl="http://localhost:8888"


		btn1.onclick = function get1() {
			$.getJSON(`${baseUrl}/get1`).then(function (result) {
				console.log(result);
				btn1.innerHTML = JSON.stringify(result)
			});
		}


		btn2.onclick = () => $.ajax({
					url: base +"/get1",
					dataType: "jsonp",
					jsonp: "callback2",
					cache:true,
					success: function(json){
						result = json;
					}
	    });


	</script>

</body>

</html>